#include "widget.h"
#include "ui_widget.h"
#include "widget.h"
#include<QTimer>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    t=new QTimer(this);
    connect(t,&QTimer::timeout,this,&Widget::solve);
    t->start(100);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::solve()
{
    int value=ui->progressBar->value();
    if(value>=100)
    {
        t->stop();
        this->close();
        return;
    }
    ui->progressBar->setValue(value+1);
}

